home *** CD-ROM | disk | FTP | other *** search
/ STraTOS 1997 April & May / STraTOS 1 - 1997 April & May.iso / CD01 / INTERNET / SITES / GRAHAM / XA_6S.ZIP / SOURCE / LC2GCC.H < prev    next >
Encoding:
C/C++ Source or Header  |  1996-02-27  |  5.0 KB  |  182 lines

  1. /* This file is an ugly hack, but it should work.
  2.  * The definitions in here have been fetched from
  3.  * both GCC and Lattice C includes as well as from
  4.  * the MiNT sources. Some stuff is my own as well.
  5.  * 
  6.  * Craig Graham has nothing to do with this file.
  7.  * All bug reports should be directed to me (after
  8.  * you've fixed the problem of course ;-)
  9.  * 
  10.  * Johan Klockars, 950213
  11.  *
  12.  * When compiling with GCC, use -mshort.
  13.  */
  14.  
  15. #ifndef _LC2GCC_H
  16. #define _LC2GCC_H
  17.  
  18. /* Lattice C code used 'far' for some reason, remove */
  19. #define far
  20.  
  21. /* Below is to make gcc use normal evnt_multi */
  22. #define __OLD_WAY__
  23.  
  24. /* GCC uses 16 bit ints instead */
  25. #define short        int
  26.  
  27. #define __regargs
  28.  
  29. /* Strange Lattice C 3 compatibility thing */
  30. #define ADDR(a)    (a)
  31.  
  32. /* 'Unofficial' alarm function */
  33. #define tma_trap_1_wl(n, a)                            \
  34. __extension__                                \
  35. ({                                    \
  36.     register long retvalue __asm__("d0");                \
  37.     long  _a = (long) (a);                        \
  38.                                         \
  39.     __asm__ volatile                        \
  40.     ("\
  41.         movl    %2,sp@-; \
  42.         movw    %1,sp@-; \
  43.         trap    #1;    \
  44.         addqw   #6,sp "                        \
  45.     : "=r"(retvalue)            /* outputs */        \
  46.     : "g"(n), "r"(_a)            /* inputs  */        \
  47.     : "d0", "d1", "d2", "a0", "a1", "a2"    /* clobbered regs */    \
  48.       AND_MEMORY                            \
  49.     );                                \
  50.     retvalue;                            \
  51. })
  52. #define Tmalarm(sec)        tma_trap_1_wl(0x13d, (long)(sec))
  53.  
  54. /* Make do without gemfast.h */
  55. #include "k_defs.h"
  56.  
  57. typedef struct _mn_set
  58. {
  59.     long Display;    /*  the submenu display delay     */
  60.     long Drag;       /*  the submenu drag delay        */
  61.     long Delay;      /*  the single-click scroll delay */
  62.     long Speed;      /*  the continuous scroll delay   */
  63.     short Height;    /*  the menu scroll height        */
  64. } MN_SET;
  65.  
  66. typedef struct _menu
  67. {
  68.     OBJECT *mn_tree;    /* the object tree of the menu */
  69.     short   mn_menu;    /* the parent object of the menu items */
  70.     short   mn_item;    /* the starting menu item */
  71.     short   mn_scroll;  /* the scroll field status of the menu 
  72.                            0  - The menu will not scroll
  73.                            !0 - The menu will scroll if the number of menu
  74.                                 items exceed the menu scroll height. The 
  75.                 non-zero value is the object at which 
  76.                 scrolling will begin.  This will allow one
  77.                 to have a menu in which the scrollable region
  78.                 is only a part of the whole menu.  The value
  79.                 must be a menu item in the menu.
  80.                 
  81.                                 menu_settings can be used to change the menu
  82.                                 scroll height. 
  83.  
  84.                          NOTE: If the scroll field status is !0, the menu
  85.                                items must consist entirely of G_STRINGS. */
  86.     short   mn_keystate; /* The CTRL, ALT, SHIFT Key state at the time the
  87.                 mouse button was pressed. */
  88. } MENU_T;
  89.  
  90. #define __TCC_COMPAT__
  91.  
  92. typedef struct
  93. {
  94. #ifdef __TCC_COMPAT__
  95.     void        *fd_addr;
  96. #else /* !__TCC_COMPAT__ */
  97.     long        fd_addr;    /* Addrerss of upper left corner of first*/
  98.                                     /* plane of raster area. If NULL then   */
  99.                                     /* MFDB is for a physical device        */
  100. #endif /* !__TCC_COMPAT__ */
  101.     short        fd_w;        /* Form Width in Pixels                 */
  102.     short        fd_h;       /* Form Height in Pixels                */
  103.     short        fd_wdwidth; /* Form Width in shorts(fd_w/sizeof(int)*/
  104.     short        fd_stand;   /* Form format 0= device spec 1=standard*/
  105.     short        fd_nplanes; /* Number of memory planes              */
  106.     short        fd_r1;      /* Reserved                             */
  107.     short        fd_r2;      /* Reserved                             */
  108.     short        fd_r3;      /* Reserved                             */
  109. } MFDB;
  110.  
  111. #define S_ONLY         3
  112. #define S_OR_D         7
  113.  
  114. typedef struct mouse_form
  115.     {
  116.     short    mf_xhot;
  117.     short     mf_yhot;
  118.     short     mf_nplanes;
  119.     short    mf_bg;
  120.     short     mf_fg;
  121.     short     mf_mask[16];
  122.     short     mf_data[16];
  123.     } MFORM ;
  124.  
  125. #define MD_REPLACE    1
  126. #define MD_TRANS    2
  127. #define MD_XOR        3
  128. #define MD_ERASE    4
  129.  
  130. /* Something out of the Lattice C includes */
  131. #define FIS_HOLLOW    0
  132. #define FIS_SOLID    1
  133. #define FIS_PATTERN    2
  134. #define FIS_HATCH    3
  135. #define FIS_USER    4
  136.  
  137. #define THICKENED    0x0001
  138. #define SHADED        0x0002
  139. #define SKEWED    0x0004
  140. #define UNDERLINED    0x0008
  141. #define OUTLINE    0x0010
  142. #define SHADOW    0x0020
  143.  
  144. #define _GEMFAST_H
  145. #include <aesbind.h>
  146. #include <vdibind.h>
  147.  
  148. #define G_CICON    33
  149.   
  150. #define FL3DMASK    0x0600
  151. #define FL3DNONE    0x0000
  152. #define FL3DIND    0x0200
  153. #define FL3DBAK    0x0400
  154. #define FL3DACT    0x0600
  155.  
  156. #define SPECIAL    0x0040
  157.  
  158. #define LK3DIND    1
  159. #define LK3DACT    2
  160. #define INDBUTCOL    3
  161. #define ACTBUTCOL    4
  162. #define BACKGRCOL    5
  163. #define AD3DVALUE    6
  164.  
  165. #define M_SAVE    258
  166. #define M_RESTORE    259
  167. #define M_PREVIOUS    260
  168.  
  169. #define WF_OWNER    20
  170. #define WF_BEVENT    24
  171. #define WF_BOTTOM    25
  172. #define WF_ICONIFY    26
  173. #define WF_UNICONIFY    27
  174. #define WF_UNICONIFYXYWH    28
  175. #define WF_TOOLBAR    30
  176. #define WF_FTOOLBAR    31
  177. #define WF_NTOOLBAR    32
  178.  
  179. /* Could not find this definition anywhere but in the MiNT sources! */
  180. #define O_GLOBAL    0x1000
  181. #endif
  182.